package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.PaymentHystrixFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 孙志鹏
 * @createDate 2022/4/5 18:23
 */
@RestController
@RequestMapping("/payment/consumer")
public class OrderHystrixController {

    @Resource
    private PaymentHystrixFeignService paymentHystrixFeignService;

    @GetMapping("/ok/{id}")
    public String paymentInfoOK(@PathVariable("id") Integer id) {
        return paymentHystrixFeignService.paymentInfoOK(id);
    }

    @GetMapping("/timeout/{id}")
    public String paymentInfoTimeout(@PathVariable("id") Integer id) {
        return paymentHystrixFeignService.paymentInfoTimeout(id);
    }

}
